<?if($data->profile->status == 'online'):?>
<li>
    <a id="chat"><?=_('Send a video chat request')?></a>
</li>
<script type="text/javascript">
    $('#chat').click(function(){
        tool.confirm('<?=_("Confirm")?>','<?=("Are you sure sent a video chat request this member?")?>','_request()');
    });
    function _request(){
        tool.post({'url':'/json/chat/request',
            'data':'ID=<?=$data->profile->ID?>',
            'onComplete':function(r){
                if(r.code==200)	{
                    location.href = '/chat/room/'+r.chat.room;
                }
                else return tool.result(400,"<?=_('Alert')?>','<?=_('Please try again later..')?>");
            }
        });
    }
</script>
<?endif;?>